"""Json tool"""

import re


def extract_code_block(code_type: str, sample_string: str):
    pattern = rf"```{code_type}\n([\s\S]*)\n```"
    match = re.search(pattern, sample_string)
    if match:
        return match.group(1)

    return None
